const app = {
  state: {
    appVersion: '0.0.1',
    iframeSrc: '',
    paginationDefultData: {
      pageNum: 1,
      pageRow: 10,
      totalCount: 0,
      pageSizes: [10, 20, 50, 100],
      layout: 'total, sizes, prev, pager, next, jumper'
    },
    dialogVisible: false
  },
  mutations: {
    APP_VERSION: (state, data) => {
      state.searchParams.drinkSales = data
    },
    IFRAME_SRC: (state, data) => {
      state.iframeSrc = data
    },
    DIALOG_VISIBLE: (state, data) => {
      state.dialogVisible = data
    }
  },
  actions: {
    getAppVersion: ({
      commit
    }) => {
      commit('APP_VERSION')
    },

    getIndexIframeSrc: ({
      commit
    }, data) => {
      commit('IFRAME_SRC', data)
    },

    showDialog: ({
      commit
    }, data) => {
      commit('DIALOG_VISIBLE', data)
    }
  }
}

export default app
